/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pkgjeudestrategie;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import javax.swing.JComponent;

/**
 *
 * @author Admin
 */
public class Route extends Zoomable{
    int level=0;
    double factor =0;
    boolean isUpgradable=true;
    int[] prix={0,1000,5000};
    public Route(){
        
        setSize(400,400);
    }
    public void isUpgradable(){
        if(level>=3){
            isUpgradable=false;
        }
        //ce qui entrainera, dans monde, le blocage de la possibilité d'upgrader Route
    }
    public void upgrade(){
        level++;
    }
    public int getUpgradePrice(){
        if(isUpgradable){
            return prix[level+1];
        }
        else{
            return -1;
        }
    }
    public int getLevel(){
        return level;
    }
    public void paintComponent(Graphics g){
        if(level==0){
            g.setColor(Color.LIGHT_GRAY );
        }
        else if(level==1){
            g.setColor(Color.GRAY );
        }
        
       else if(level==2){
            g.setColor(Color.DARK_GRAY );
        }
       g.fillRect((int) ((getWidth()/2)-(5)), 0, (int)(getWidth()/40), (int) (getWidth())); 
       g.fillRect(0, (int) ((getWidth()/2)-(5)), (int) (getWidth()),(int)(getWidth()/40)); 
    }
    
}
